export namespace routing {

    /**
     * 我的出行
     */
    export function mytrips() {
        return '/pages/mytrips/mytrips'
    }

    /**
     * 开锁
     */
    export interface UnLockOpts {
        car_id: string
    }

    export function unlock(o: UnLockOpts) {
        return `/pages/unlock/unlock?car_id=${o.car_id}`
    }

    /**
     * 租车驾照注册
     */
    export interface RegisterOpts {
        redirect?: string
    }

    export interface RegisterParams {
        redirectURL: string
    }

    export function register(p?: RegisterParams) {
        const page = `/pages/register/register`
        if (!p) {
            return page
        }
        return `${page}?redirect=${encodeURIComponent(p.redirectURL)}`
    }


    /**
     * 出行计费
     */
    export interface DrivingOpts {
        trip_id: string
    }


    export function driving(o: DrivingOpts) {
        return `/pages/driving/driving?trip_id=${o.trip_id}`
    }

}
